<?php include("ajaxinlcudes.php");
$q =$_GET['q'];
$rs_resources = searchResources($q);
$row_rs_resources = mysql_fetch_assoc($rs_resources);
$totalRows_rs_resources = mysql_num_rows($rs_resources);
$isCheckbox = true;

if(isset ($_GET['c'])){
    $isCheckbox=!$isCheckbox;
    $radioBtnName = $_GET['c'];
}
?> 
<?php  if($totalRows_rs_resources>0){ ?>
<div class="resource_max">
<table width="100%" border="0" cellpadding="4" cellspacing="0" id="datatable">
  <tr>
    <th>resource id</th>
    <th>category</th>
    <th>
            <?php  if($isCheckbox){?>
      <input type="checkbox" name="delchk123_0" id="delchk123_0">
      <?php }  ?>
    </th>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo "<span style='float:left'>".$row_rs_resources['resource_id']."</span>";
	  if($row_rs_resources['category_id']==7){
	  ?><a rel="<?php echo $f; ?>" href="../resources/<?php echo $row_rs_resources['resource_url']; ?>" >
      <img name="" src="../resources/thump.php?im=<?php echo $row_rs_resources['resource_url']; ?>"  alt="" />
          </a><?php }else{
              echo  "| ".substr($row_rs_resources['resource_url'],strripos($row_rs_resources['resource_url'], "/")+1);
          } ?>
     </td>
      <td> <?php echo $row_rs_resources['category_name']; ?> - <?php echo $row_rs_resources['resource_description']; ?></td>
      <td>
          <?php  if($isCheckbox){?>
       <input type="checkbox" name="delchk123_<?php echo $row_rs_resources['resource_id']; ?>" id="delchk123_<?php echo $row_rs_resources['resource_id']; ?>" value="<?php echo $row_rs_resources['resource_id']; ?>">
 <?php } else { ?>
      <input type="radio" name="<?php echo $radioBtnName; ?>" id="delchk123_<?php echo $row_rs_resources['resource_id']; ?>" value="<?php echo $row_rs_resources['resource_id']; ?>" <?php if(@$_GET["check"]==$row_rs_resources['resource_id']) echo "checked='checked'"; ?>>
 <?php } ?>
             </tr>
    <?php } while ($row_rs_resources = mysql_fetch_assoc($rs_resources)); ?>
</table>
</div>
<?php } else { ?>
<div id="error">NO match found for <strong><?php echo $_GET['q'];?></strong></div>
<?php }
mysql_free_result($rs_resources);
?>
